import { defineConfig } from 'vite';
import uni from "@dcloudio/vite-plugin-uni";
import generateUniext from './uni_modules/kux-router/vite/vite-plugin-generate-uniext.ts'
import autopages from './uni_modules/kux-autopages';
import kuxgen from './uni_modules/kux-router/vite/vite-plugin-kux-gen';

export default defineConfig({
	plugins: [
		generateUniext, // 该配置为可选项，主要是为了使用uni.xxx的语法
		uni(),
		autopages({
			pagesJsonMappingFile: 'router/pages.uts', // 该参数未配置时，默认在项目根目录下生成 `pages.interface.uts`
		}),
		kuxgen({
			pagesJsonMappingFile: 'router/pages.uts', // 该参数同上
			routerFile: 'router/router.uts'
		})
	],
})